package function;

import java.util.function.Consumer;
import java.util.function.Supplier;

/**
 * @ClassName: MySupplier
 * @Author: 王延
 * @Date: 2019/7/24 15:50
 * @Description :
 */
public class MySupplier {
    public static void main(String[] args) {
        Supplier<String> supplier = () -> "生产者";
        System.out.println(supplier.get());


        //void accept(T t);
        Consumer<String> consumer = (String s) -> {
            System.out.println("消费者");
            System.out.println(s.startsWith("z"));
        };
        consumer.accept("消费者");
    }
}
